<!DOCTYPE html>
<html>
<head>
<title>SMM交易中心</title>
</head>

<body class="page-header-top-fixed">

<div class="page-header">
	<!--头部开始-->
	<#include "/include/top.html" />
	<!-- 头部信息结束 -->


	<!-- 头部菜单开始-->
	<#include "/include/top_menu.html" />
	<!-- 头部菜单结束 -->
</div>

<!-- 内容开始 -->
	<input type="hidden" id="customerId" value="${customerId}">
	<div class="portlet-body" style="padding-top: 10px">
		<div class="row">
			<div style="float: left;width: 80%;padding-left: 15px;">
				<div class="btn-group pull-left">
					<div class="row" style="height: 56px; text-align:left ;padding-left: 27px;padding-top: 8px;">
						<div class="col-sm-12">
							<div id="sample_2_filter" class="dataTables_filter">
							<div style="float: left;padding-left: 0px;padding-bottom: 7px;" class="col-md-6">
								<div class="btn-group btn-group-justified" > 
									<a href="${request.getContextPath()}/orders/customerDetail.do?customerId=${customerId}" class="btn btn-default">企业信息</a>
									<a href="${request.getContextPath()}/orders/orderList.do?customerId=${customerId}" class="btn green">订单记录</a>
									<a href="${request.getContextPath()}/orders/releaselist.do?customerId=${customerId}" class="btn btn-default">发布记录</a>
									<a href="${request.getContextPath()}/orders/favorite.do?customerId=${customerId}" class="btn btn-default">收藏记录</a>
								</div>
							</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			
			<div style="float: right;width: 8%">
				<a  class="btn green" href="${request.getContextPath()}/customer/customerList.do">
					<i class="fa"></i> 返回
				</a>
			</div>
		</div>
	</div>




<div class="page-container">
			<div class="container-fluid">
			<div class="row margin-top-10">
				<div class="col-md-12">
				<div class="portlet light bordered">
					<div class="table-scrollable">


					<table class="table table-striped table-bordered table-advance table-hover ttTbl" id="myTable" >
						<thead>
							<tr>
								<th scope="col">
									订单编号
								</th>
								<th scope="col">
									分类
								</th scope="col">
								<th>
									信息标题
								</th>
								<th scope="col">
									类型
								</th>
								<th scope="col">
									数量
								</th>
								<th scope="col">
									单价
								</th>
								<th scope="col">
									总金额
								</th>
								<th scope="col">
									下单时间
								</th>
								<th scope="col">
									成交时间
								</th>
								<th scope="col">
									状态
								</th>
							</tr>
						</thead>
						<tbody>
							<#list ordersList as order>
							<tr>
								<td>
									<a href="javascript:void(0)" onclick="orderDetail(${order.id})">${order.orderNo}</a>
								</td>
								<td>
									${order.metalName!'--'}
								</td>
								<td>
								<#if order.source?? && order.source=1>
									<a href="${request.getContextPath()}/supply/supplyDetail.do?id=${order.sourceId}">${order.infoTitle}</a>
								</#if>
								<#if order.source?? && order.source=2>
									<a href="${request.getContextPath()}/Purchase/purchasDetail.do?id=${order.sourceId}">${order.pTitle}</a>
								</#if>
								<#if order.source?? && order.source=3>
									${order.orderTitle}
								</#if>
								</td>
								<td>
									<#if order.source?? && order.source=1>
										供货
									</#if>
									<#if order.source?? && order.source=2>
										采购
									</#if>
									
								</td>
								<td> 
									${order.quantity?string('###.#####')}
									<#if order.quantityUnit?? && order.quantityUnit=0>吨</#if>
								</td>
								<td>
									${order.price?string('###.##')}
									<#if order.priceUnit?? && order.priceUnit=0>
									元
									<#else>
									美元
									</#if>
								</td>
								<td>
									<#if order.quantity?? && order.price??>
										${(order.quantity*order.price)?string('#.##')}
										<#if order.priceUnit?? && order.priceUnit=0>
										元
										<#else>
										美元
										</#if>
									</#if>
								</td>
								<td>
									<#if order.createdAt??>
										${order.createdAt?string('yyyy-MM-dd')}
									<#else>
										--
									</#if>
								</td>
								<td>
									<#if order.dealTime??>
										${order.dealTime?string('yyyy-MM-dd')}
									<#else>
										--
									</#if>
								</td>
								<td>
									<#if order.orderStatus?? && order.orderStatus=0>
										待确认
									</#if>
									<#if order.orderStatus?? && order.orderStatus=1>
										未成交
									</#if>
									<#if order.orderStatus?? && order.orderStatus=2>
										已成交
									</#if>
									<#if order.orderStatus?? && order.orderStatus=3>
										已撤销
									</#if>
								</td>
							</tr>
							</#list>
							</tbody>
							</table>
</div>
	<div style="width:80%;margin:0 auto;">
		<div id="kkpager">
			<input type="hidden" value="${totalPage}" id="totalPage">
			<input type="hidden" value="${totalRecords}" id="totalRecords">
		</div>
	</div>
</div>
</div>
</div>
</div>


<!-- 底部开始 -->
<#include "/include/foot.html" />
<!-- 底部结束 -->
</body>

<link href="${request.getContextPath()}/Public/assets/admin/css/css.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css">

<link href="${request.getContextPath()}/Public/assets/global/css/components-rounded.css" id="style_components" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/css/plugins.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/admin/css/layout.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/admin/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color">
<link href="${request.getContextPath()}/Public/assets/admin/css/custom.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css">

<link href="${request.getContextPath()}/Public/assets/admin/css/common.css" rel="stylesheet" type="text/css">

<link rel="shortcut icon" href="${request.getContextPath()}/Public/favicon.ico">
<link href="${request.getContextPath()}/Public/css/client.css" rel="stylesheet" type="text/css">

<link href="${request.getContextPath()}/Public/assets/global/css/kkpager.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/css/customerDetail.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="${request.getContextPath()}/Public/My97DatePicker/WdatePicker.js"></script>

<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.js"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/admin/scripts/layout.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/kkpager.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/admin/scripts/commonUtils.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/js/ckeditor/ckeditor.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function() {
	Metronic.init(); // init metronic core componets
	Layout.init(); // init layout
	CommonUtils.checkInit();

});

//初始化分页插件
function getParameter(name) { 
	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 
	var r = window.location.search.substr(1).match(reg); 
	if (r!=null) return unescape(r[2]); return null;
}

//init
$(function(){
	
	var totalPage = $('#totalPage').val();
	var totalRecords = $('#totalRecords').val();
	var customerId = $('#customerId').val();
	
	var pageNo = getParameter('pno');
	if(!pageNo){
		pageNo = 1;
	}
	//生成分页
	//有些参数是可选的，比如lang，若不传有默认值
	kkpager.generPageHtml({
		pno : pageNo,
		//总页码
		total : totalPage,
		//总数据条数
		totalRecords : totalRecords,
		
		getLink : function(n){
			return this.hrefFormer + this.hrefLatter + "?customerId="+customerId+"&pno="+n;
		}	
	});
});


function orderDetail(orderId){
	CommonUtils.editModal(BASE_URL + "/order/queryOrderInfo.do?id="+orderId, 1000);
}
</script>

</html>